bpo-45522: Allow to disable freelists on build time#29056
bpo-45522: Allow to disable freelists on build time#29056miss-islington merged 5 commits intopython:mainfrom
Conversation
|
8770f42 to
754b256
Compare
Freelists for object structs can now be disabled. A new :program:`configure` option :option:`!--without-freelists` can be used to disable all freelists except empty tuple singleton. Signed-off-by: Christian Heimes <christian@python.org>
754b256 to
2af07c2
Compare
|
One unit test is failing when building Python |
|
What is your motivation for this change? Is it an experimental change? Freelists are important for Python performance. Shipping a Python without them doesn't seem useful. I disabled freelists in the past when working on subinterpreters. But I modified the code in the meanwhile to make them per-interpreter. |
My motivations are listed in the ticket. tl;dr it's for alternative memory allocators like If you don't like the configure option, then I can split the PR up into the internal C code fixes and the public configure option. I definitely want to land the C code changes. They also fix various bugs when |
|
PR GH-29086 is a minimal version of this PR without the configure flag. |
|
@tiran I prefer this version for our future experiment :) |
There was a problem hiding this comment.
I am okay with this PR for future experiments.
I believe that mimalloc will be adopted at least for improving performance.
see: Benchmark result which Trian and Neil digged at this sprint -> https://gist.github.com/pablogsal/8027937b71cd30f17aaaa5ef7c885d3e
* main: (263 commits) bpo-45521: Fix a bug in the obmalloc radix tree code. (pythonGH-29051) bpo-45522: Allow to disable freelists on build time (pythonGH-29056) bpo-34451: Document prompt and output toggle feature in html tutorial (pythonGH-27105) bpo-44019: Add operator.call() to __all__ for the operator module (pythonGH-29110) bpo-45315: PyType_FromSpec: Copy spec->name and have the type own the memory for its name (pythonGH-29103) bpo-44220: Export PyStructSequence_UnnamedField in the limited API (pythonGH-26331) bpo-44174: [Enum] add reference to name mangling (pythonGH-29116) bpo-45548: add some missing entries to `Modules/Setup` (pythonGH-29115) bpo-35673: Add a public alias for namespace package __loader__ attribute (python#29049) bpo-45192: Fix a bug that infers the type of an os.PathLike[bytes] object as str (pythonGH-28323) bpo-45527: Don't count cache hits, just misses. (pythonGH-29092) bpo-45320: Remove long-deprecated inspect methods (pythonGH-28618) bpo-41374: Remove obsolete exclusion of netinet/tcp.h on Cygwin (pythonGH-21649) bpo-45532: Replace 'default' with 'main' as default in sys.version (pythonGH-29100) bpo-45464: [doc] Explain that subclassing multiple exceptions is fragile (pythonGH-29094) Cleanup a couple of comments left on PR 28775 post-merge. (pythonGH-29079) bpo-45536: Check OpenSSL APIs in configure (pythonGH-29088) Add PEPs 593 & 647 to list of PEPs at top of typing docs (pythonGH-29097) Add a comment about how to fix bogus test_host_resolution_bad_address failures (python#29085) bpo-44525: Specialize simple Python calls. (pythonGH-29033) ...
Freelists for object structs can now be disabled. A new
configureoption
--without-freelistscan be used to disable all freelistsexcept empty tuple singleton. Internal Py*_MAXFREELIST macros can now
be defined as 0 without causing compiler warnings and segfaults.
Signed-off-by: Christian Heimes christian@python.org
https://bugs.python.org/issue45522
Automerge-Triggered-By: GH:tiran